package com.yd.controller.yd;

import java.io.InputStream;
import java.util.Iterator;
import java.util.Properties;

public class YD_Can {

	public static String getUrlValue(String urlName) {
		String url = null;
		Properties prop = new Properties();
		try {
			ClassLoader classLoader = YD_Can.class.getClassLoader();// 读取属性文件xxxxx.properties
			InputStream in = classLoader.getResourceAsStream("url_can.properties");
			prop.load(in); /// 加载属性列表
			Iterator<String> it = prop.stringPropertyNames().iterator();
			while (it.hasNext()) {
				if (it.next().equals(urlName)) {
					url = prop.getProperty(urlName);
				}
			}
			in.close();
		} catch (Exception e) {

		}
		return url;
	}

	public static void main(String[] args) {
		System.out.println(getUrlValue("ex_add"));

	}

	// public static void main(String[] args) throws MalformedURLException,
	// IOException {
	//
	// /*
	// JSONObject yd_users_token=YD_Users.getUsersByToken(token);
	// if(yd_users_token.getString("error").equals("1")){
	// System.out.println(yd_users_token.getString("msg"));
	// }
	// JSONObject
	// users_token=JSONObject.parseObject(yd_users_token.getString("data"));
	// */
	//
	// /*
	// JSONObject yd_users_uid=YD_Users.getUsersByUid(uid);
	// if(yd_users_uid.getString("error").equals("1")){
	// System.out.println(yd_users_uid.getString("msg"));
	// }
	// JSONObject
	// users_uid=JSONObject.parseObject(yd_users_uid.getString("data"));
	// */
	//
	//
	// JSONObject yd_users_uid=YD_Users.getUsersByUid("20");
	// if(yd_users_uid.getString("error").equals("1")){
	// System.out.println(yd_users_uid.getString("msg"));
	// }
	// JSONObject
	// users_uid=JSONObject.parseObject(yd_users_uid.getString("data"));
	//
	// System.out.println(users_uid.getString("phone"));
	// }

}
